﻿
using Base.Common;
 using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
 namespace Base.ClientUI {
    public class HttpSysUtil {
        public static String UserName;
        public static String pass="lg6666";
        public static List<ShowCache> showLog() {
            try {
                JArray data = WCSHttpUtil.getArray(WCSHttpUtil.baseUrl + "open/logger");
                if( data == null ) {
                    return null;
                }
                 List<ShowCache> list = JsonConvert.DeserializeObject<List<ShowCache>>(data.ToString());
                return list;
            } catch { 
                 
            }
            return null;
        }
         ///Crane/IsAutoRunning/craneId/
        static public List<TaskStat> getStat() {
            JArray data = WCSHttpUtil.getArray(WCSHttpUtil.baseUrl + "open/task");
            if(data == null) {
                return null;
                ;
            }
            List < TaskStat > list= JsonConvert.DeserializeObject<List<TaskStat>>(data.ToString());
            return list;
        }
         static public List<String> login(String name,String password) {
             JArray data = WCSHttpUtil.getArray(WCSHttpUtil.baseUrl + "Sys/login/" + name+"/"+ password);
            if( data == null ) {
                return null;
                ;
            }
            List<String> list = JsonConvert.DeserializeObject<List<String>>(data.ToString());
            return list;
        }
        
       
    }
}
